package org.springblade.modules.repair.vo.plan;

import cn.hutool.core.date.DateUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.core.datascope.annotation.DataAuth;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.repair.entity.MaintainPlanContentUser;
import org.springblade.modules.repair.enums.EmerProcTypeEnum;

import java.util.Date;
import java.util.List;

/**
 * @author zcc
 * @version 1.0
 * @date 2023/12/14 14:28
 */
@Data
public class PlanAffairVO {

	@ApiModelProperty("项目名称")
	private Long buildingId;

	@ApiModelProperty("项目名称")
	private String buildingName;

	@ApiModelProperty("梯号")
	private String elevatorAddress;

	@ApiModelProperty("梯号")
	private Long elevatorId;

	@ApiModelProperty("工单id")
	private Long planId;

	@ApiModelProperty("创建时间")
	private Date createTime;

	private Integer typeStatus;

	private String groupDate;

	public void setPlanDate(Date planDate) {
		this.planDate = planDate;
		this.groupDate = DateUtil.format(planDate, "yyyy")+"年" + DateUtil.format(planDate, "MM")+"月";
	}

	@ApiModelProperty("工单时间")
	private Date planDate;

	@ApiModelProperty("问题描述")
	private String planDesc;

	@ApiModelProperty("工单状态")
	private Integer planStatus;

	@ApiModelProperty("工单状态")
	private String planStatusName;

	/**
	 * 紧急程度
	 */
	private Integer emerProcType;

	/**
	 * 紧急程度描述
	 */
	private String emerProcTypeName;

	private Date updateTime;


	public void setEmerProcType(Integer emerProcType) {
		if(Func.isNotEmpty(emerProcType)){
			this.emerProcTypeName = EmerProcTypeEnum.getName(emerProcType);
		}
		this.emerProcType = emerProcType;
	}

	/**
	 * 关联人员
	 */
	private List<MaintainPlanContentUser> planContentUserVos;
}
